backgroundtex = surface.GetTextureID( "background" )

function ShowSHAIDstuffs()
local ply = LocalPlayer()
DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 100,100 )
DermaPanel:SetSize( 250, 600 )
DermaPanel:SetTitle( "SHAID operations" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( false )
DermaPanel:MakePopup()
DermaPanel:SetDraggable( false )
DermaPanel.Paint = function() -- Paint function
    surface.SetDrawColor( 0, 0, 0, 200 ) -- Set our rect color below us; we do this so you can see items added to this panel
    surface.DrawRect( 0, 250, DermaPanel:GetWide(), DermaPanel:GetTall()-250 ) -- Draw the rect
surface.SetTexture(backgroundtex)
surface.SetDrawColor(255,255,255,200)
surface.DrawTexturedRect(0,0,250,250)

end

ExtraPanel = vgui.Create( "DFrame" )
ExtraPanel:SetPos( ScrW() - 350,100 )
ExtraPanel:SetSize( 250, 600 )
ExtraPanel:SetTitle( "Limb_Health operations" )
ExtraPanel:SetVisible( true )
ExtraPanel:SetDraggable( true )
ExtraPanel:ShowCloseButton( false )
ExtraPanel:MakePopup()
ExtraPanel:SetDraggable( false )
ExtraPanel.Paint = function() -- Paint function
    surface.SetDrawColor( 0, 0, 0, 200 ) -- Set our rect color below us; we do this so you can see items added to this panel
    surface.DrawRect( 0, 250, DermaPanel:GetWide(), DermaPanel:GetTall()-250 ) -- Draw the rect
surface.SetTexture(backgroundtex)
surface.SetDrawColor(255,255,255,200)
surface.DrawTexturedRect(0,0,250,250)
end

// SET UP //
local DermaButton1 = vgui.Create( "DButton" ) --give a good name to these so that they are easier to track
DermaButton1:SetParent( DermaPanel ) 
DermaButton1:SetText( "Create Spawn" )
DermaButton1:SetPos( 25, 50 )
DermaButton1:SetSize( 200, 20 )
DermaButton1.DoClick = function ()
	if(ply:IsAdmin() or ply:IsSuperAdmin()) then
    RunConsoleCommand("SHAID_add_spawn")
	end
end

local DermaButton2 = vgui.Create( "DButton" ) 
DermaButton2:SetParent( DermaPanel ) 
DermaButton2:SetText( "Opt In" )
DermaButton2:SetPos( 25, 75 )
DermaButton2:SetSize( 200, 20 )
DermaButton2.DoClick = function ()
    RunConsoleCommand("SHAID_Opt_in")
end

local DermaButton3 = vgui.Create( "DButton" ) 
DermaButton3:SetParent( DermaPanel ) 
DermaButton3:SetText( "Commence SHAID" )
DermaButton3:SetPos( 25, 100 )
DermaButton3:SetSize( 200, 20 )
DermaButton3.DoClick = function ()
	if(ply:IsAdmin() or ply:IsSuperAdmin()) then
    RunConsoleCommand("SHAID_Toggle")
	end
end

local DermaButton1 = vgui.Create( "DButton" ) 
DermaButton1:SetParent( DermaPanel ) 
DermaButton1:SetText( "Remove All Spawns" )
DermaButton1:SetPos( 25, 125 )
DermaButton1:SetSize( 200, 20 )
DermaButton1.DoClick = function ()
    RunConsoleCommand("SHAID_Remove_all_spawns")
end


// OPTIONS //
local CheckBoxThing = vgui.Create( "DCheckBoxLabel", DermaPanel )
CheckBoxThing:SetPos( 25, 160 )
CheckBoxThing:SetText( "Zombies Only" )
	if(ply:IsAdmin() or ply:IsSuperAdmin()) then
CheckBoxThing:SetConVar( "SHAID_Zombies_only" ) -- ConCommand must be a 1 or 0 value
CheckBoxThing:SetValue( 0 )
	end
CheckBoxThing:SizeToContents()

local CheckBoxThing2 = vgui.Create( "DCheckBoxLabel", DermaPanel )
CheckBoxThing2:SetPos( 25,185 )
CheckBoxThing2:SetText( "Antlions Only" )
	if(ply:IsAdmin() or ply:IsSuperAdmin()) then
CheckBoxThing2:SetConVar( "SHAID_Antlions_only" ) -- ConCommand must be a 1 or 0 value
CheckBoxThing2:SetValue( 0 )
	end
CheckBoxThing2:SizeToContents()

if(ply:IsAdmin() or ply:IsSuperAdmin()) then
local NumSliderThingy = vgui.Create( "DNumSlider", DermaPanel )
NumSliderThingy:SetPos( 25,215 )
NumSliderThingy:SetSize( 200, 100 ) -- Keep the second number at 100
NumSliderThingy:SetText( "Middle Number of NPCs" )
NumSliderThingy:SetMin( 10 ) -- Minimum number of the slider
NumSliderThingy:SetMax( 30 ) -- Maximum number of the slider
NumSliderThingy:SetDecimals( 1 ) -- Sets a decimal. Zero means it's a whole number
NumSliderThingy:SetConVar( "SHAID_NPC_volume" ) -- Set the convar
end
// SELF HEAL SECTION //

local Heading1= vgui.Create("DLabel", ExtraPanel)
Heading1:SetText("Click the limb you wish to heal")
Heading1:SetPos( 25, 25) 
Heading1:SetSize( 200, 20) 

local LH_HEAD = vgui.Create( "DButton" ) 
LH_HEAD:SetParent( ExtraPanel ) 
LH_HEAD:SetText( " " )
LH_HEAD:SetPos( 109, 50 )
LH_HEAD:SetSize( 32, 32 )
LH_HEAD.DoClick = function ()
    RunConsoleCommand("Self_Heal", "1")
end

local LH_BODY = vgui.Create( "DButton" ) 
LH_BODY:SetParent( ExtraPanel ) 
LH_BODY:SetText( " " )
LH_BODY:SetPos( 95, 82 )
LH_BODY:SetSize( 60, 120 )
LH_BODY.DoClick = function ()
    RunConsoleCommand("Self_Heal", "2")
end

local LH_LARM = vgui.Create( "DButton" ) 
LH_LARM:SetParent( ExtraPanel ) 
LH_LARM:SetText( " " )
LH_LARM:SetPos( 15, 82 )
LH_LARM:SetSize( 80, 20 )
LH_LARM.DoClick = function ()
    RunConsoleCommand("Self_Heal", "4")
end

local LH_RARM = vgui.Create( "DButton" )
LH_RARM:SetParent( ExtraPanel ) 
LH_RARM:SetText( " " )
LH_RARM:SetPos( 155, 82 )
LH_RARM:SetSize( 80, 20 )
LH_RARM.DoClick = function ()
    RunConsoleCommand("Self_Heal", "5")
end

local LH_LLEG = vgui.Create( "DButton" ) 
LH_LLEG:SetParent( ExtraPanel ) 
LH_LLEG:SetText( " " )
LH_LLEG:SetPos( 95, 202 )
LH_LLEG:SetSize( 24, 120 )
LH_LLEG.DoClick = function ()
    RunConsoleCommand("Self_Heal","6")
end

local LH_RLEG = vgui.Create( "DButton" ) 
LH_RLEG:SetParent( ExtraPanel ) 
LH_RLEG:SetText( " " )
LH_RLEG:SetPos( 131, 202 )
LH_RLEG:SetSize( 24, 120 )
LH_RLEG.DoClick = function ()
    RunConsoleCommand("Self_Heal", "7")
end

local CheckBoxThing69 = vgui.Create( "DCheckBoxLabel", ExtraPanel )
CheckBoxThing69:SetPos( 25,340 )
CheckBoxThing69:SetText( "Over the Shoulder cam" )
CheckBoxThing69:SetConVar( "Shoulder_View" ) -- ConCommand must be a 1 or 0 value
CheckBoxThing69:SetChecked( tobool(Shoulder_View:GetFloat()) )
CheckBoxThing69:SetValue( 1 )
CheckBoxThing69:SizeToContents()

local CheckBoxThing1337 = vgui.Create( "DCheckBoxLabel", ExtraPanel )
CheckBoxThing1337:SetPos( 25,360 )
CheckBoxThing1337:SetText( "First Person Ragdoll" )
CheckBoxThing1337:SetConVar( "sh_fpdeath" ) -- ConCommand must be a 1 or 0 value
CheckBoxThing1337:SetChecked( tobool(fpsmackwoo:GetFloat())  )
CheckBoxThing1337:SetValue( 1 )
CheckBoxThing1337:SizeToContents()

end

function closepanel()
DermaPanel:Close()
ExtraPanel:Close()
end
usermessage.Hook( "call_vgui", ShowSHAIDstuffs )
usermessage.Hook( "close_vgui", closepanel )




